fix: patch Wardline 1.0.5 review regressions#46
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0752a28f8a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| elif isinstance(stmt, ast.ExceptHandler) and stmt.name: | ||
| yield stmt.name |
There was a problem hiding this comment.
Handle except aliases when shadowing TYPE_CHECKING
When the shadowing binding is except ... as TYPE_CHECKING, this branch never runs because _own_statements() yields only ast.stmt children and recurses through ExceptHandler bodies rather than yielding the handler node itself. In a handler such as except ValueError as TYPE_CHECKING: if TYPE_CHECKING: raise ..., the module-level TYPE_CHECKING alias therefore remains in the scoped alias map, so the reachable raise is still treated as a dead typing-only branch and the boundary rules can report the wrong result for exception-handler validation paths. Collect handler names while visiting ast.Try/ast.TryStar instead.
Useful? React with 👍 / 👎.
Summary
Reviewed all commits merged into
mainin the last 24 hours (window anchored at 2026-06-19 08:07:31 +10:00):477e33beJohn Morrissey — docs: fix doc/site rot surfaced in review. Docs/site version and link cleanup; no code regression found.19089461John Morrissey — fix: make TYPE_CHECKING reachability scope-aware. Found a remaining reachability bug for function-local non-typing imports that shadowTYPE_CHECKING; fixed here.117649caJohn Morrissey — feat: warpline delta scan (wardline scan --affected) + review hardening. Found over-expansion in caller closure when an affected file also contained unrelated entities; fixed here.17cbcb96John Morrissey — fix: reject --affected with --fail-on. Surface policy is correct; no further bug found.ea6faebeJohn Morrissey — fix: mark advisory affected scans not evaluated. Engine verdict behavior is covered by existing tests; no further bug found.c09c80b7John Morrissey — chore: prepare wardline 1.0.4. Release metadata was consistent and PyPI 1.0.4 is installable.Fixes
typingimports. This prevents a falsePY-WL-102whenTYPE_CHECKINGis rebound to a runtime value.--affectedcaller closure from resolved affected qualnames rather than every entity in each affected file. This keeps callers of unrelated co-file helpers out of the advisory delta scan.1.0.5and add changelog entries with commit references.Verification
uv run pytest --cov=wardline --cov-report=term-missing --cov-fail-under=90— 4189 passed, 18 deselected, coverage 92.43%.uv run ruff check src testsuv run ruff format --check src testsuv run mypyuv run wardline scan . --fail-on ERROR— 0 active findings.uv run wardline scan src/ --format sarif --output /tmp/wardline-self-scan.sarif --fail-on ERROR— 0 active findings.uv builduvx twine check dist/*uvx --from ./dist/wardline-1.0.5-py3-none-any.whl[scanner] wardline --version— 1.0.5.npm --prefix site run build